package com.xsy.android.compose.we.component.ui.page.home

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.NavHostController
import androidx.navigation.compose.rememberNavController
import com.xsy.android.compose.we.component.ui.page.chat.ChatList
import com.xsy.android.compose.we.component.view_model.WeViewModel

/**
 *@author: xiaosy
 *时间: 2024/6/26
 *@Description: home page
 *@Version: 1.0
 **/
@Composable
fun HomePage(modifier: Modifier = Modifier, navController: NavHostController) {
    val viewModel: WeViewModel = viewModel()
    ChatList(chats = viewModel.chats,navController)
}


@Preview(showBackground = true)
@Composable
fun PreviewHomePage() {
    val navController = rememberNavController()
    HomePage(navController = navController)
}